
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name = "Etudiant")

public class Etudiant {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int CIN;
    private String nom;
    private String prenom;
    private float age;
    private int cin;

    // constructeur par défaut (obligatoire pour Hibernate)
    public Etudiant() {}

    public Etudiant(String nom, String prenom, float age) {
        this.nom = nom;
        this.prenom = prenom;
        this.age = age;
    }



    public String getNom() {
        return nom;
    }

    public void setNom(String nom) {
        this.nom = nom;
    }

    public String getPrenom() {
        return prenom;
    }

    public void setPrenom(String prenom) {
        this.prenom = prenom;
    }

    public float getAge() {
        return age;
    }

    public void setAge(float age) {
        this.age = age;
    }

    public int getCin() {
        return cin;
    }

    public void setCin(int cin) {
        this.cin = cin;
    }

    @Override
    public String toString() {
        return "Etudiant [CIN: "+cin + ", nom: "+nom + ", prenom: "+prenom + ", age: "+age+"]";
    }
}
